import { defineStore } from "pinia";
import { ref } from "vue";

export const useMemberStore = defineStore('member', () => {
    // 用户信息
    const profile = ref()
    // 存入用户信息
    const setProfile = (data: any) => {
        profile.value = data
    }
    // 清除用户信息
    const clearProfile = () => {
        profile.value = null
    }
    return {
        profile,
        setProfile,
        clearProfile
    }


}, { 
    // persist: true ,
    persist:{

        storage:{
            getItem(key) {
                return uni.getStorageSync(key)
                
            },
            setItem(key, value) {
                return uni.setStorageSync(key, value)
            }
            
        }
    }
    

})